package com.zeng.dao;

import com.zeng.pojo.User;
import com.zeng.utils.Mybatis;
import org.apache.ibatis.session.SqlSession;
import org.apache.log4j.Logger;
import org.junit.Test;
import sun.rmi.runtime.Log;

import java.util.List;

/**
 * @author zeng
 * @data 2021/07/02 18:56
 */
public class GetUser {
    //日志对象
    static Logger logger = Logger.getLogger(GetUser.class);
    public static void main(String[] args) {
        //得到Sqlsession对象
        SqlSession seession = Mybatis.getSqlSeession();
        //得到mapper
        UserMapper mapper = seession.getMapper(UserMapper.class);
        //执行方法
        List<User> user = mapper.getUser();
        for (User user1 : user) {
            System.out.println(user1);
        }
    }

    @Test
    public void getName(){
        logger.info("info:进入了getName");
        logger.debug("debug:进入了getName");
        logger.error("error:进入了getName");
    }
}


